import { useState, useEffect } from 'react';

export function useSetPageTitle(initTitle) {
  const [title, setTitle] = useState(initTitle || '默认标题');
  useEffect(() => {
    document.title = title;
  }, [title]);
  return [title, setTitle];
}
